<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page import="java.util.Calendar" %>
<% String title = "信息综合系统"; %>
<%@ include file="/WEB-INF/jsp/header.jsp" %>
<title><%=title %>-流向日志管理</title>
<head>

<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta name="apple-itunes-app" content="app-id=429849944"/>
<meta name="apple-touch-fullscreen" content="no"/>
<meta content="telephone=no" name="format-detection"/>
<meta name="apple-mobile-web-app-capable" content="no"/>
</head>

<!-- BEGIN BODY -->
<body class="fixed-top" style="background: #fff;">

<jsp:include page="/common/headerPage.jsp"></jsp:include>
<!-- BEGIN CONTAINER 容器 -->
<div id="container" class="row-fluid">
    <!-- BEGIN SIDEBAR 侧边栏-->
    <jsp:include page="/common/left.jsp"></jsp:include>
    <!-- END SIDEBAR -->

    <!-- BEGIN PAGE -->
    <div id="main-content">
        <!-- BEGIN PAGE CONTAINER-->
        <div class="container-fluid">
            <!-- BEGIN PAGE HEADER-->
            <div class="row-fluid">
                <div class="span12">
                    <!-- BEGIN PAGE TITLE & BREADCRUMB-->
                    <h3 class="page-title">流向日志管理</h3>
                    <ul class="breadcrumb" style="padding-bottom : 12px;">
                        <li><a href="${pageContext.request.contextPath}/user/index.do">首页</a>
                            <span class="divider">/</span></li>
                        <li class="active">流向日志管理</li>
                        <li class="pull-right search-wrap">
                            <input type="button" class="btn  btn-info" onclick="toggleCondi();" id="show"
                                   value="隐藏筛选区域"/>
                             &nbsp;&nbsp;
                             <div class="btn-group pull-right">
			                    <button class="btn dropdown-toggle" data-toggle="dropdown">更多 <i class="icon-angle-down"></i>
			                    </button>
			                    <ul class="dropdown-menu pull-right">
			                        <li><a href="${pageContext.request.contextPath}/planLog/download.do">下载已筛选流向日志</a></li>
			                    </ul>
			                </div>     
                        </li>
                    </ul>
                    <!-- END PAGE TITLE & BREADCRUMB-->
                </div>
            </div>
            <!-- END PAGE HEADER-->
            <!-- BEGIN BASIC PORTLET-->
            <div class="widget">
                <div class="row-fluid">
                    <div class="clearfix" >
                    <form id="filterForm">
	                    <input type="text" class="span2" id="planid" name="id" placeholder="请填写流向ID" 
	                    onblur="if(!/^[0-9]+$/.test(this.value)){layer.msg('ID只能输入【数字】');this.value='';}"  />
	                    <%-- <input type="text" class="span2" id="client" name="client" placeholder="请填写客户" data-provide="typeahead"
	                               data-items="4"/>
	                    <select id="product" name="product" multiple="multiple"
	                        onMouseOver="this.title='选择品种'" size="1"
	                        class="input-medium m-wrap">
	                        <c:forEach items="${products}" var="product" >
	                           <option value="${product}">${product}</option>
	                       </c:forEach>
	                    </select> 
	                    <select id="pack" size="1" name="pack" multiple="multiple"
	                         class="input-medium m-wrap">
	                        <c:forEach items="${packs}" var="page">
	                            <option value="${page}">${page}</option>
	                        </c:forEach>
	                    </select>
	                    <input type="text" class="span3 typeahead" id="terminal" name="terminal" placeholder="请填写入货乙方" data-provide="typeahead" data-items="4" />
	 --%>
	                    <input type="button" id="seach" name="seach" value="查询" class="btn  btn-primary"
	                               style="margin-bottom: 10px;"
	                               onclick="query(pNumber,pSize);">
	                    
                    </form>
                    </div>
                </div>
               
				<div class="row-fluid">
                	<div class="span12">
                    <!-- BEGIN ALERTS PORTLET-->
                    <div class="widget blue">
                        <div class="widget-title">
                            <h4><i class="icon-reorder"></i>流向日志查询列表
                                <a href="javascript:;" id="getProp" style ="color:white;margin-left:20px;">复制选中行id</a>
                            </h4>
                            <span class="tools">
								<a href="javascript:;" class="icon-chevron-down"></a>
							</span>
                        </div>
				    
                        <div class="widget-body" style="overflow:auto">
	                        <div class="pageBottom" style="text-align:center;">
	                            <input type="hidden" id="page-size" value="0"/>
	                            <div id="callBackPager" class="paging_bootstrap pagination"></div> 
	                        </div>
                        	<table class="table table-striped table-hover table-bordered" width="2640px;"
                                   style="table-layout:fixed;font-size: 12px;">
                                   <thead>
                                   <tr>
                                       <th style="width:25px;">logid</th>
                                       <th style="width:40px;">修改者</th>
                                       <th style="width:130px;">修改时间</th>
                                       <th style="width:25px;">修改类型</th>
                                       
                                       <th style="width:55px;">日期</th>
                                       <th style="width:50px;">片区</th>
                                       <th style="width:100px;">出货甲方</th>
                                       <th style="width:25px;">行为</th>
                                       <th style="width:100px;">入货乙方</th>
                                       <th style="width:50px;">QS名</th>
                                       <th style="width:95px;">省份/经理/提成人</th>
                                       <th style="width:35px;">协议id</th>
                                       <th style="width:60px;">协态/方案</th>
                                       <th style="width:55px;">品规/模式</th>
                                       <th style="width:25px;">数量</th>
                                       <th style="width:120px;">客户/条线/代表</th>
                                       <th style="width:50px;">结算方式</th>
                                       <th style="width:45px;">1服务费(基础)</th>
                                        <th style="width:40px;">1金额</th>
                                       <th style="width:100px;">1状态</th>
                                       <th style="width:50px;">3服务费(财务)</th>
                                       <th style="width:40px;">3金额</th>
                                       <th style="width:100px;">3状态</th>
                                       <th style="width:50px;">4服务费(达标)</th>
                                       <th style="width:40px;">4金额</th>
                                       <th style="width:100px;">4状态</th>
                                       <th style="width:50px;">总费用</th>
                                       <th style="width:50px;">5开发奖励</th>
                                       <th style="width:40px;">5金额</th>
                                       <th style="width:100px;">5状态</th>
                                       <th style="width:50px;">业务员奖励</th>
                                       <th style="width:50px;">业务员奖励金额</th>
                                       <th style="width:100px;">业务员奖励状态</th>
                                       <th style="width:50px;">大区</th>
                                       <th style="width:70px;">地市</th>
                                       <th style="width:30px;">区县</th>
                                       <th style="width:40px;">销售折量</th>
                                       <th style="width:40px;">生产折量</th>
                                       <th style="width:80px;">批号</th>
                                       <th style="width:100px;">分部</th>
                                       <th style="width:30px;">渠道</th>
                                       <th style="width:40px;">级别</th>
                                       <th style="width:45px;">中标价</th>
                                       <th style="width:45px;">配送率</th>
                                       <th style="width:45px;">开票价</th>
                                       <th style="width:50px;">标准测算价</th>
                                       <th style="width:50px;">协议测算价</th>
                                       <th style="width:60px;">中标金额</th>
                                       <th style="width:60px;">开票金额</th>
                                       <th style="width:70px;">大区提成人</th>
                                       <th style="width:60px;">区域主管</th>
                                       <th style="width:70px;">贡献提成人</th>
                                       <th style="width:90px;">片区存量来源</th>
                                       <th style="width:90px;">片区存量提成</th>
                                       <th style="width:90px;">片区增量来源</th>
                                       <th style="width:90px;">片区增量提成</th>
                                       <th style="width:115px;">片区晚交流向扣减</th>
                                       <th style="width:115px;">片区晚交流向提成</th>
                                       <th style="width:60px;">高阶来源</th>
                                       <th style="width:60px;">高阶提成</th>
                                       <th style="width:60px;">贡献来源</th>
                                       <th style="width:60px;">贡献提成</th>
                                       <th style="width:85px;">主管存量来源</th>
                                       <th style="width:85px;">主管存量提成</th>
                                       <th style="width:85px;">主管增量来源</th>
                                       <th style="width:85px;">主管增量提成</th>
                                       <th style="width:85px;">大区存量来源</th>
                                       <th style="width:85px;">大区存量提成</th>
                                       <th style="width:85px;">大区增量来源</th>
                                       <th style="width:85px;">大区增量提成</th>
                                       <th style="width:115px;">大区晚交流向扣减</th>
                                       <th style="width:115px;">大区晚交流向提成</th>
                                       <th style="width:60px;">提成备注</th>
                                       <th style="width:60px;">提成状态</th>
                                       <th style="width:85px;">重点终端标识</th>
                                       <th style="width:70px;">好伙伴标识</th>
                                       <th style="width:85px;">晚交流向标识</th>
                                       <th style="width:100px;">真自然流向标识</th>
                                       <th style="width:200px;">流向备注</th>
                                       <th style="width:60px;">收款人</th>
                                       <th style="width:210px;">开户行</th>
                                       <th style="width:210px;">银行账号</th>
                                       <th style="width:50px;">流向ID</th>
                                       <th style="width:60px;">录入人员</th>
                                       <th style="width:60px;">录入日期</th>
                                   </tr>
                                   </thead>
                                                <tbody id="distribute-body">
                                                <input type="hidden" id="selectIds" value="${ids }"/>
                                                </tbody>

                                <tbody id="distribute-body">
                        		</tbody>
                            </table>
                        </div>

                    </div>
                    <!-- END ALERTS PORTLET-->
                	</div>
            	</div>
               
            </div>
            <!-- END BASIC PORTLET-->
        </div>
    </div>
</div>

<!-- BEGIN FOOTER -->
<jsp:include page="/common/footer.jsp"></jsp:include>
<!-- END FOOTER -->

<!-- BEGIN JAVASCRIPTS -->
<!-- Load javascripts at bottom, this will reduce page load time -->
<%--<script src="js/jquery-1.8.3.min.js"></script>--%>
<script src="${pageContext.request.contextPath}/js/jquery-1.7.1.min.js"></script>
<script src="${pageContext.request.contextPath}/js/jquery.nicescroll.js" type="text/javascript"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-ui-1.9.2.custom.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.slimscroll.min.js"></script>
<script src="${pageContext.request.contextPath}/js/fullcalendar.min.js"></script>
<script src="${pageContext.request.contextPath}/js/bootstrap.min.js"></script>
<script src="${pageContext.request.contextPath}/js/jquery.easy-pie-chart.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/js/jquery.sparkline.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/js/Chart.js"></script>
<script src="${pageContext.request.contextPath}/js/jquery.scrollTo.min.js"></script>
<!--common script for all pages-->
<script src="${pageContext.request.contextPath}/js/common-scripts.js"></script>

<script type="text/javascript" src="${pageContext.request.contextPath}/js/layer/layer.js"></script>
<%--<script src = "${pageContext.request.contextPath}/js/jquery.min.js" > </script>--%>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/bootstrap-multiselect.js"></script>
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap-multiselect.css" type="text/css"/>

<script src="${pageContext.request.contextPath}/js/bootstrap-typeahead.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/extendPagination.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="http://img3.job1001.com/js/ZeroClipboard/jquery.zclip.min.js"></script>

<!-- END JAVASCRIPTS -->
<!-- 自定义的script方法 -->
<script type="text/javascript">
    $(document).ready(function () {
    	selectMoreItem('product','品种','80px');
        selectMoreItem('pack','包装','80px'); 
        $("#show").click(function () {
            $(".clearfix").slideToggle();
        });
        /*通过ID查询*/
           
    });
    var terminal = ${condiMap.terminal};
    $('#terminal').typeahead({source: terminal})
    if ( window.clipboardData ) {
        $('#getProp').click(function() {
            var ids = getProp();  
            if(selectedIds.trim().length>0){
       		   ids = selectedIds;
       	    }
            if(ids.trim().length>0){
                window.clipboardData.setData("Text", ids);
                layer.msg("复制成功！"); 
                $("#allAndNotAll").attr("checked", false);  
                $("input[name='choice']:checkbox").each(function(){ 
                    $(this).attr("checked", false);  
              	});
                layer.msg("复制成功！");
            }else{
                layer.alert("您没有选中行！");
            }
        });
    } else {
        $("#getProp").zclip({
            path:'http://img3.job1001.com/js/ZeroClipboard/ZeroClipboard.swf',
            copy:function(){
                   var ids = getProp();  
                   if(selectedIds.trim().length>0){
              		   ids = selectedIds;
              	    }
                   if(ids.trim().length>0){
                       return ids;
                   }else{
                       layer.msg("您没有选中行！");
                   }
                },
            afterCopy:function(){
            	layer.msg("复制成功！"); 
                $("#allAndNotAll").attr("checked", false);  
                $("input[name='choice']:checkbox").each(function(){ 
                    $(this).attr("checked", false);  
              	});
            	layer.msg("复制成功！");
            }
        });
    }
</script>

<script type="text/javascript">
    function query(pageNumber, pageSize) {
    	var planid = $("#planid").val();
        if(planid.trim()==''){
            layer.msg("请填写流向ID!");
        }else{
	        var url = "${pageContext.request.contextPath }/planLog/selectForList.do?pageNumber="
	                + pageNumber + "&pageSize=" + pageSize;
	        var params = $("#filterForm").serialize();
	        queryList(url,params);
        }
    }

    //动态创建table
    function createTable(currPage, limit, total, items) {
        var html = [], showNum = limit;
        if (total - (currPage * limit) < 0) showNum = total - ((currPage - 1) * limit);
        for (var i = 0; i < showNum; i++) {
        	html.push("<tr>");
        	
        	html.push('<td>' + formatData(items[i].logId) + '</td>');
            html.push('<td>' + formatData(items[i].logDataer) + '</td>');
            html.push('<td>' + formatData(items[i].logTime) + '</td>');
            html.push('<td>' + formatData(items[i].logType) + '</td>');
            
            html.push('<td>' + formatData(items[i].sdate) + '</td>');
            html.push('<td>' + formatData(items[i].space) + '</td>');
            html.push('<td>' + formatData(items[i].commercial1) + '</td>');
            html.push('<td>' + formatData(items[i].judge) + '</td>');
            html.push('<td>' + formatData(items[i].terminal) + '</td>');
            html.push('<td>' + formatData(items[i].zhenghe_qs) + '</td>');
            html.push('<td>' + formatData(items[i].province)+ '/' + formatData(items[i].mgr)+ '/' +formatData(items[i].tichengbelong)+ '</td>');
            html.push('<td>' + formatData(items[i].clientpolicyId)+ '</td>');
            html.push('<td>' + formatData(formatData(items[i].policystatus)+ '/' +items[i].kaipiaofangshi)  + '</td>');
            html.push('<td>' + formatData(items[i].product)+ formatData(items[i].pack)+ '/' +formatData(items[i].mode) + '</td>');
            html.push('<td>' + formatData(items[i].count) + '</td>');
            html.push('<td>' + formatData(items[i].client)+ '/' + formatData(items[i].xieyizhuangtai)+ '/' + formatData(items[i].daibiao)+'</td>');
            html.push('<td>' + formatData(items[i].jsmode) + '</td>');
            html.push('<td>' + formatData(items[i].basic1) + '</td>');
            html.push('<td>' + formatData(items[i].money1) + '</td>');
            html.push('<td>' + formatData(items[i].status1) + '</td>');
            html.push('<td>' + formatData(items[i].piaoju3) + '</td>');
            html.push('<td>' + formatData(items[i].money3) + '</td>');
            html.push('<td>' + formatData(items[i].status3) + '</td>');
            html.push('<td>' + formatData(items[i].dabiao4) + '</td>');
            html.push('<td>' + formatData(items[i].money4) + '</td>');
            html.push('<td>' + formatData(items[i].status4) + '</td>');
            html.push('<td>' + formatData(items[i].totalmoney) + '</td>');
            html.push('<td>' + formatData(items[i].kaifa5) + '</td>');
            html.push('<td>' + formatData(items[i].money5) + '</td>');
            html.push('<td>' + formatData(items[i].status5) + '</td>');
            
            html.push('<td>' + formatData(items[i].kaifaMgr) + '</td>');
            html.push('<td>' + formatData(items[i].moneyMgr) + '</td>');
            html.push('<td>' + formatData(items[i].statusMgr) + '</td>');
            
            html.push('<td>' + formatData(items[i].daqu) + '</td>');
            html.push('<td>' + formatData(items[i].city) + '</td>');
            html.push('<td>' + formatData(items[i].county) + '</td>');
            html.push('<td>' + formatData(items[i].xsScount) + '</td>');
            html.push('<td>' + formatData(items[i].scount) + '</td>');
            html.push('<td>' + formatData(items[i].pihao) + '</td>');
            html.push('<td>' + formatData(items[i].fenbu) + '</td>');
            html.push('<td>' + formatData(items[i].terminaltype) + '</td>');
            html.push('<td>' + formatData(items[i].terminallev) + '</td>');
            
            html.push('<td>' + formatData(items[i].cuxiao_ed_money) + '</td>');
            html.push('<td>' + formatData(items[i].peisonglv) + '</td>');
            html.push('<td>' + formatData(items[i].yinyukaiguan) + '</td>');
            html.push('<td>' + formatData(items[i].yingyumoney) + '</td>');
            html.push('<td>' + formatData(items[i].atsum) + '</td>');
            
            html.push('<td>' + formatData(items[i].zhongbiaojiamoney) + '</td>');
            html.push('<td>' + formatData(items[i].kaipiaojiamoney) + '</td>');
            html.push('<td>' + formatData(items[i].daquTcMan) + '</td>');
            html.push('<td>' + formatData(items[i].zgTcMan) + '</td>');
            html.push('<td>' + formatData(items[i].gxTcMan) + '</td>');
            html.push('<td>' + formatData(items[i].danwitichen) + '</td>');
            html.push('<td>' + formatData(items[i].shijiticheng) + '</td>');
            html.push('<td>' + formatData(items[i].spaceZLDanwei) + '</td>');
            html.push('<td>' + formatData(items[i].spaceZLTc) + '</td>');
            html.push('<td>' + formatData(items[i].spaceKouJian) + '</td>');
            html.push('<td>' + formatData(items[i].spaceKouJianTc) + '</td>');
            html.push('<td>' + formatData(items[i].gaoJieDanwei) + '</td>');
            html.push('<td>' + formatData(items[i].gaoJieTc) + '</td>');
            html.push('<td>' + formatData(items[i].gxDanwei) + '</td>');
            html.push('<td>' + formatData(items[i].gxTc) + '</td>');
            html.push('<td>' + formatData(items[i].zgDanwei) + '</td>');
            html.push('<td>' + formatData(items[i].zgTc) + '</td>');
            html.push('<td>' + formatData(items[i].zgDanwei_zl) + '</td>');
            html.push('<td>' + formatData(items[i].zgTc_zl) + '</td>');
            html.push('<td>' + formatData(items[i].jicengbutie7) + '</td>');
            html.push('<td>' + formatData(items[i].money7) + '</td>');
            html.push('<td>' + formatData(items[i].daquZLDanwei) + '</td>');
            html.push('<td>' + formatData(items[i].daquZLTc) + '</td>');
            html.push('<td>' + formatData(items[i].daquKouJian) + '</td>');
            html.push('<td>' + formatData(items[i].daquKouJianTc) + '</td>');
            html.push('<td>' + formatData(items[i].jianli) + '</td>');
            html.push('<td>' + formatData(items[i].tcstatus) + '</td>');
            html.push('<td>' + formatData(items[i].focusonFlag) + '</td>');
            html.push('<td>' + formatData(items[i].goodFriendFlag) + '</td>');
            html.push('<td>' + formatData(items[i].money6) + '</td>');
            html.push('<td>' + formatData(items[i].status6) + '</td>');
            html.push('<td>' + formatData(items[i].demo) + '</td>');
            html.push('<td>' + formatData(items[i].shoukuangren) + '</td>');
            html.push('<td>' + formatData(items[i].kaihuhang) + '</td>');
            html.push('<td>' + formatData(items[i].zhanghao) + '</td>');
            html.push('<td>' + formatData(items[i].id) + '</td>');
            html.push('<td>' + formatData(items[i].dataer) + '</td>');
            html.push('<td>' + formatData(items[i].today) + '</td>');
            html.push('</tr>');
        }
        var mainObj = $('#distribute-body');
        mainObj.empty();
        mainObj.html(html.join(''));
    };


</script>
<!-- END BODY -->
<script>
    var htmls = $("#updatePlanLogForm").html();
    var uploadFileHtml = $("#uploadFileForm").html();
    var ret = null;
    //所有选中的id
    var selectedIds = "";
    /* //全选或全不选
    $("#allAndNotAll").click(function() { 
        if (this.checked){  
            $("input[name='choice']:checkbox").each(function(){ 
                  $(this).attr("checked", true);  
            });
            layer.msg('拼命执行中，请稍等……', {icon: 16}, function(){
            	layer.closeAll();
            	layer.load(2);
            	//发送异步请求，获取数据
                sendRequest(pageContextPath + "/planLog/selectIds.do", null, function (jsonData) {
                    selectedIds = jsonData.ids;
                    layer.closeAll();
                });
            });
        } else {   
            $("input[name='choice']:checkbox").each(function() {   
                  $(this).attr("checked", false);  
            });
            selectedIds="";
        }  
    }); */
</script>
<script src="${pageContext.request.contextPath}/javascript/httpService.js"></script>
<style type="text/css">
	.Textwrap {  
		width: 150px; 
		white-space: nowrap; 
		text-overflow: ellipsis; 
		overflow: hidden; 
	} 
</style>
</body>
</html>